package io.robot.wechat;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Wuaj
 */
@Configuration
@EnableConfigurationProperties(WeChatConfig.class)
@ConditionalOnProperty(prefix = WeChatAutoConfig.PREFIX, name = "enabled", havingValue = "true")
@Slf4j
public class WeChatAutoConfig {

    public static final String PREFIX = "we.chat.wexin";

    @Bean
    public WeChatConfig WeChatConfig() {
        return new WeChatConfig();
    }

}
